package com.dcsgo.socketPlay.test;


import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

/**
 * @author DCSGO
 * @version 1.0
 */
public class setProperties {
    public static void set(String filePath) throws IOException {
        Properties properties = new Properties();
        properties.setProperty("serverIP", "127.0.0.2");
        properties.setProperty("serverPort", "9999");
        properties.store(new FileWriter(filePath), "serverSet");
    }

    public static void setGameProperties(String filePath) throws IOException {
        Properties gameProperties = new Properties();
        gameProperties.setProperty("gameFrameWidth", "100");
        gameProperties.setProperty("gameFrameHeight", "100");
        gameProperties.setProperty("gamePanelWidth", "100");
        gameProperties.setProperty("gamePanelHeight", "100");
        gameProperties.setProperty("ballSize", "10");
        gameProperties.store(new FileWriter(filePath), "gameProperties");
    }

    public static void main(String[] args) throws IOException {
        //set("./serverProperties.properties");
        setGameProperties("./game.properties");
    }
}
